function calculate() {
  let g = 9.8
  let input1 = parseFloat(document.getElementById("input1").value);   //m1
  let input2 = parseFloat(document.getElementById("input2").value);   //m2
  let input3 = parseFloat(document.getElementById("input3").value);  //mp
  let input4 = parseFloat(document.getElementById("input4").value);  //k2
  let input5 = parseFloat(document.getElementById("input5").value);   //s1
  let input6 = parseFloat(document.getElementById("input6").value);   //s2
  let input7 = parseFloat(document.getElementById("input7").value);  //sp
  let input8 = parseFloat(document.getElementById("input8").value);   //μ1
  let input9 = parseFloat(document.getElementById("input9").value);  //φ2
  let input10 = parseFloat(document.getElementById("input10").value);   //μp
  let input11 = parseFloat(document.getElementById("input11").value);  //θ1
  let input12 = parseFloat(document.getElementById("input12").value);   //θp
  let input13 = parseFloat(document.getElementById("input13").value);  //h



  if (!input1 ) input1  = 0;
  if (!input2 ) input2  = 0;
  if (!input3 ) input3  = 0;  
  if (!input4 ) input1  = 0;
  if (!input5 ) input2  = 0;
  if (!input6 ) input3  = 0;
  if (!input7 ) input1  = 0;

  // console.log("input1=",input1)
  // console.log("input2=",input2)
  


  //v1的结果
  let result = ((input1*Math.cos(input11)*Math.sqrt(2*g*input8*input5)+input3+Math.sqrt(2*g)*input10*Math.cos(input12)*(Math.sqrt(input13+input7/input10)-Math.sqrt(input13)))/(input1+input3))*3.6

  //v2的结果
  let result1 = ((input1*Math.sin(input11)*Math.sqrt(2*g*input8*input5)+input3+Math.sqrt(2*g)*input10*Math.cos(input12)*(Math.sqrt(input13+input7/input10)-Math.sqrt(input13)) + input2 * Math.sqrt(2*g*input9*input4*input6) )/input2 ) *3.6

  if (result == 'NaN') {
    result = 0
    alert('请按要求输入数据！')
    location.reload()
  }

  //v1的结果
  document.getElementById("result").textContent = result.toFixed(2);
   //v2的结果
  document.getElementById("result1").textContent = result1.toFixed(2);

}